import { createRouter, createWebHistory } from 'vue-router'
import Index from '../views/index/index.vue'
import FirstTable from '../views/table/first-table.vue'
import EditableTable from '../views/table/editable-table.vue'
import Parent from '../views/parent-child/parent.vue'
import GlobalDefination from '../views/global-defination/global-defination.vue'
import PatientInfo from '../views/select/patient-info.vue'
import DateTimePicker from '../views/date-time-picker.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      component: Index,
      meta:{
        title: '首页'
      },
      children: [
        {
          path: 'table',
          component: FirstTable,
          meta: {
            title: '表格全屏与样式覆盖'
          }
        },{
          path: 'editable-table',
          component: EditableTable,
          meta: {
            title: '可编辑表格'
          }
        },{
          path: 'pc',
          component: Parent,
          meta: {
            title: '父组件修改子组件属性及响应对象'
          }
        },{
          path: 'global-def',
          component: GlobalDefination,
          meta: {
            title: '全局定义'
          }
        },{
          path: 'select-test',
          component: PatientInfo,
          meta: {
            title: 'Select测试'
          }
        },{
          path: 'date-time-test',
          component: DateTimePicker,
          meta: {
            title: 'DateTimePicker测试'
          }
        }
      ]
    },{
      path: '/userApp',
      component: Index,
      meta: {
        title: 'User子应用',
        isSubApp: true
      }
    },{
      path: '/:pathMatch(.*)*',
      component:Index
    }
  ]
})

export default router
